using System;
using System.Runtime.Serialization;

namespace DemoService
{
    public class Customer
    {
        [DataMember]
        public Guid CustomerId { get; set; }
        [DataMember]
        public string FirstName { get; set; }
        [DataMember]
        public string LastName { get; set; }
        [DataMember]
        public string PhoneNumber { get; set; }

        public override bool Equals(object obj)
        {
            bool result = false;

            var other = obj as Customer;

            if(other != null)
            {
                result = (other.CustomerId.Equals(CustomerId));
            }
            return result;
        }

        public override int GetHashCode()
        {
            return (FirstName + LastName).GetHashCode();
        }
    }
}